<template>
    <view class="main">
        <view class="item" v-for="(item,index) in list" @click="goDetail(item.goods_sign)" :key="index">
            <text class="title">{{item.title}}</text>
            <img :src="item.img" alt="">
            <view class="clear">
                
            </view>
            <text class="scribePrice">{{item.scribe_price}}</text>
            <text class="price">{{item.price}}</text>
        </view>
        <view class="clear">

        </view>
    </view>
</template>

<script>
    export default {
        name: "goods",
        props: {
            list: {
                type: Array
            }
        },
        data() {
            return {

            };
        },
        methods: {
            goDetail: function(goodsSign) {
                uni.navigateTo({
                    url: `/pages/product/info?goods_sign=${goodsSign}`
                })
            }
        },
        onReachBottom() {
            console.log('子组件触底');
        }
    }
</script>

<style lang="scss" scoped>
    .main {

        border: 0rpx solid red;
        margin: 0 auto;
        // height: 1450rpx;

        margin: {
            top: 20rpx;
        }

        ;

        .item {
            float: left;
            width: 45%;
            min-width: 45%;
            padding: 10rpx;

            border: {
                width: 0rpx;
                style: solid;
                color: lightgray;
                radius: 10rpx;
            }

            ;
            height: 35%;
            background-color: #fff;

            margin: {
                left: 16rpx;
                bottom: 20rpx;
            }

            ;

            padding: {
                bottom: 20rpx;
            }

            ;

            .title {
                display: block;
                font-size: 32rpx;
                color: #000;
                height: 90rpx;
                overflow: hidden;
                text-overflow: ellipsis;
                width: 94%;
                min-width: 94%;
                margin: 0 auto;

                margin: {
                    bottom: 20rpx;
                    top: 20rpx;
                }

                ;
            }

            img {
                width: 330rpx;
                height: 300rpx;
                border-radius: 10rpx;
            }

            .scribePrice {
                display: block;
                float: left;
                font-size: 26rpx;
                color: lightgray;
                border: 0rpx solid blue;

                margin: {
                    left: 10rpx;
                }

                ;
                text-decoration: line-through;
            }

            .price {
                display: block;
                font-size: 28rpx;
                color: red;
                height: 40rpx;
                overflow: hidden;
                margin: 0 auto;
                float: right;
                border: 0rpx solid red;

                ::after {
                    content: "元";
                    font-size: 34rpx;

                    margin: {
                        left: 4rpx;
                        right: 10rpx;
                    }

                    ;
                }
                ::before{
                    content: "￥";
                    /* #ifdef H5 */
                    font-size: 12rpx !important;
                    /* #endif */
                    /* #ifndef H5 */
                    font-size: 20rpx !important;
                    /* #endif */
                }
            }
        }
    }
</style>